---
title: TODOPopupControl diary-task confirmation
summary: Confirms creation of a Diary/Claim task, optionally requiring and validating a Mail ID against employee data.
status: draft
owner: <owner>
last_reviewed: 2026-08-21
library: SAIF.Presentation.Web.Controls.PopUps.Infragistics111
reference_type: package
operation_id: OP-6
trigger: Hosting page constructs a clsPopupTask (task id/message/claim id/type/mailid-required flag), assigns it to Task, and sets Active = True.
---

# TODOPopupControl diary-task confirmation

This operation prompts the user to confirm creation of a Diary/Claim task, optionally requiring and validating an entered Mail ID against employee data before confirming.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-6 |
| **Trigger** | Hosting page constructs a `clsPopupTask` (task id/message/claim id/type/mailid-required flag), assigns it to `Task`, and sets `Active = True`. |
| **Inputs** | `Task` (`clsPopupTask`), entered Mail ID |
| **Outputs** | `ConfirmAction(Confirm, TODOTaskEventArgs)` |
| **Primary components** | `TODOPopupControl.CreateChildControls`, `TODOPopupControl.Render`, `TODOPopupControl.YesButtonClick`, `TODOPopupControl.ValidateMailid`, `TODOPopupControl.NoButtonClick` |
| **Entry point** | `SAIF.Presentation.Web.Controls.PopUps.Infragistics111\TODOPopupControl.vb` |

## Steps

1. `CreateChildControls()` parses `TODOPopup.ascx`, resolves `txtTodoMailId`, `cmdTodoYes`, `cmdTodoNo`; wires an Enter-key JS handler (`TodoEnterKeyPress`) that triggers the Yes button's postback, and `Click` handlers for Yes/No.
2. `Render()` ([BR-POPUP-005](../business-rules.md#br-popup-005-a-%22requiredtask%22-diary-task-offers-only-acknowledgement-(no-decline-option))):
   - Sets the task message text.
   - Chooses one of two Mail ID prompt labels depending on `Task.MailidRequired`, adjusting the Mail ID textbox position accordingly.
   - Clears any prior read-only/error styling.
   - Shows/hides the "Do you wish to create a Claim Task?" prompt and the No button based on `Task.TaskType`: `RequiredTask` hides the No button and relabels Yes as "OK".
   - Focuses the Mail ID textbox.
3. On Yes (`YesButtonClick`) ([BR-POPUP-004](../business-rules.md#br-popup-004-todo-diary-task-mail-id-must-resolve-to-a-valid-employee-when-required-or-supplied)):
   - Reads the posted Mail ID directly from `Request.Item(...)` (uppercased/trimmed).
   - If `MailidRequired` and empty: marks invalid.
   - If non-empty: calls `ValidateMailid()` → `clsEmployeeData.GetDataByMailID(DataPortalInfo, mailid)` (referenced package call, not traced further)** and requires `IsValid`.
   - On success: resets the textbox and raises `ConfirmAction(True, New TODOTaskEventArgs(mailid, Task))`.
   - On failure: keeps the popup active and applies an `"errorbackcolor"` CSS class to flag the invalid Mail ID field.
4. On No (`NoButtonClick`): resets the textbox and raises `ConfirmAction(False, New TODOTaskEventArgs("", Task))`.

## Process flow

The following diagram visualizes the diary-task confirmation flow.

```mermaid
flowchart TD
	Start([Hosting page constructs clsPopupTask, sets Active = True]) --> Create[CreateChildControls parses ASCX]
	Create --> Render[Render prompt based on TaskType/MailidRequired]
	Render --> Action{Yes or No clicked}
	Action -->|Yes| MailCheck{Mail ID required and empty?}
	MailCheck -->|Yes| Invalid([Mark invalid, popup stays active])
	MailCheck -->|No| Validate[ValidateMailid via clsEmployeeData.GetDataByMailID]
	Validate --> Valid{IsValid?}
	Valid -->|Yes| Confirm([ConfirmAction True with TODOTaskEventArgs])
	Valid -->|No| Invalid
	Action -->|No| Cancel([ConfirmAction False])
```

## Failure and edge-case behavior

- An unresolvable or required-but-missing Mail ID keeps the popup active and flags the Mail ID field with `"errorbackcolor"` rather than raising `ConfirmAction` ([BR-POPUP-004](../business-rules.md#br-popup-004-todo-diary-task-mail-id-must-resolve-to-a-valid-employee-when-required-or-supplied)).
- `RequiredTask` tasks hide the No button entirely — the user can only acknowledge, not decline ([BR-POPUP-005](../business-rules.md#br-popup-005-a-%22requiredtask%22-diary-task-offers-only-acknowledgement-(no-decline-option))).

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)

## Sources
- `SAIF.Presentation.Web.Controls.PopUps.Infragistics111\TODOPopupControl.vb`
- `SAIF.Presentation.Web.Controls.PopUps.Infragistics111\TODOPopup.ascx`
